import VueRouter from 'vue-router'

//导入tabbar组件
import home from './components/tabbar/home.vue'
import member from './components/tabbar/member.vue'
import search from './components/tabbar/search.vue'
import shopcar from './components/tabbar/shopcar.vue'
import newslist from './components/news/newsList.vue'
import newsInfo from './components/news/newsInfo.vue'
import photoList from './components/photo/photoList.vue'
import photoInfo from './components/photo/photoInfo.vue'
import goodsList from './components/goods/goodsList.vue'
import goodsInfo from './components/goods/goodsInfo.vue'
import goodsDes from './components/goods/goodsDes.vue'
import goodsCmt from './components/goods/goodsCmt.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: home },
    { path: '/home/newslist', component: newslist },
    { path: '/home/newslist/:id', component: newsInfo },
    { path: '/member', component: member },
    { path: '/search', component: search },
    { path: '/shopcar', component: shopcar },
    { path: '/home/photolist', component: photoList },
    { path: '/home/photoInfo/:id', component: photoInfo },
    { path: '/home/goodsList', component: goodsList },
    { path: '/home/goodsInfo/:id', component: goodsInfo },
    { path: '/home/goodsDes/:id', component: goodsDes },
    { path: '/home/goodsCmt/:id', component: goodsCmt },
  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router